import java.lang.reflect.Array;

public class Test {

    public static void test1(int a) {
        if(a==10) {
            throw new NullPointerException();
        }
    }

    public static void main(String[] args) {
        try{
            test1(10);

        }catch (NullPointerException e) {
            System.out.println("haha");
        }
    }

    public static void main1(String[] args) {
        try {
            //System.out.println(10/0);
            int[] array = {1,2,3};
            array = null;
            System.out.println(array[0]);
            System.out.println("1234");
        }catch(Exception e) {
            e.printStackTrace();

        }/*catch(ArithmeticException e) {
            System.out.println("出现算数异常！");
        }catch (NullPointerException e) {
            e.printStackTrace();
            System.out.println("空指针异常！");
        }catch (ArrayIndexOutOfBoundsException e) {
            System.out.println("数组越界异常！");
        }*/

        System.out.println("执行后续代码！！");
    }
}
